package com.ruoyi.performance.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.performance.api.RemotePerformanceApi;
import com.ruoyi.performance.domain.SysPerformanceType;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RemotePerformanceFallbackFactory implements FallbackFactory<RemotePerformanceApi> {

    @Override
    public RemotePerformanceApi create(Throwable cause) {
        return new RemotePerformanceApi() {


            @Override
            public R<List<SysPerformanceType>> getAll() {
                return R.fail("RemotePerformanceApi调用失败");
            }
        };
    }
}
